package com.dyj.tiktok.handler;

import com.dyj.common.config.AgentConfiguration;
import com.dyj.common.domain.DyTikTokResult;
import com.dyj.common.domain.query.UserInfoQuery;
import com.dyj.tiktok.domain.vo.TikTokInfoVo;

public class UserHandler extends AbstractTikTokHandler{

    public UserHandler(AgentConfiguration agentConfiguration) {
        super(agentConfiguration);
    }

    private final static String FIEIDS = "open_id,union_id,avatar_url,avatar_url_100,avatar_large_url,display_name,bio_description,profile_deep_link,is_verified,username,follower_count,following_count,likes_count,video_count";

    public DyTikTokResult<TikTokInfoVo> getUserInfo(String openId) {
        UserInfoQuery query = new UserInfoQuery();
        query.setOpen_id(openId);
        query.setTenantId(agentConfiguration.getTenantId());
        query.setClientKey(agentConfiguration.getClientKey());
        return getUserClient().getUserInfo(query, FIEIDS);
    }
}
